\section{Dirlist.mui}

Dirlist class provides a quick and easy way of showing
entries in a directory. It features lots of control
attributes, many of them known from the popular asl
file requester.

This class is $\ast$not$\ast$ intended to replace asl.library!
Nobody wants to see every MUI application coming with
another selfmade file requester. Please continue using ASL
for real file requesting purposes!

However, sometimes it may be useful to have a little directory
list placed somewhere in your user interface. Imagine an
answering machine tool that stores incoming calls in a
preconfigured directory. Using a dirlist object, you can
include the GUI for selecting a call in your window with
lots of other gadgets like ''Play'', ''Delete'', etc.

Dirlist class offers all of a files attributes:
name, size, date, time, flags and comment. Using the
MUIA\_List\_Format attribute, you can control which of
them shall be displayed.

If you want to read the entries of your directory,
just send the dirlist object a MUIM\_List\_GetEntry
method. You will receive a pointer to a
struct FileInfoBlock which remains valid until
your next call to MUIM\_List\_GetEntry.

\subsection[MUIM\_Dirlist\_ReRead]{MUIM\_Dirlist\_ReRead (V4)}

\subsubsection*{SYNOPSIS}
DoMethod(obj,MUIM\_Dirlist\_ReRead,);

\subsubsection*{FUNCTION}
Force the dirlist object to reread the current
directory.

\subsubsection*{EXAMPLE}
\small
\begin{verbatim}
if (NewCallReceived())
   DoMethod(dirlistobj,MUIM_Dirlist_ReRead);

\end{verbatim}
\normalsize
\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Directory

\subsection[MUIA\_Dirlist\_AcceptPattern]{MUIA\_Dirlist\_AcceptPattern -- (V4) [IS.], STRPTR}

\subsubsection*{FUNCTION}
Entries not matching this pattern are rejected.
Note that the pattern has to be parsed with
dos.library/ParsePatternNoCase().

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_RejectPattern, MUIA\_Dirlist\_FilterDrawers

\subsection[MUIA\_Dirlist\_Directory]{MUIA\_Dirlist\_Directory -- (V4) [ISG], STRPTR}

\subsubsection*{FUNCTION}
Set a new directory for the dirlist object.
Since reading a directory can take a long long
time, MUI delegates this work to a sub task.

Setting this attribute causes the object to clear
the current directory (if any) and start loading
a new one. MUIA\_Dirlist\_Status will be set to
MUIV\_Dirlist\_Status\_Reading and the sub task will
be launched.

By listening to MUIA\_Dirlist\_Status, you can learn
if the directory reading is completed or if something
went wrong.

A value of NULL just clears the current directory and
sets MUIA\_Dirlist\_Status to MUIV\_Dirlist\_Status\_Invalid.

\subsubsection*{EXAMPLE}
\small
\begin{verbatim}
set(dirobj,MUIA_Dirlist_Directory,"zyxel:incoming");

\end{verbatim}
\normalsize
\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Status

\subsection[MUIA\_Dirlist\_DrawersOnly]{MUIA\_Dirlist\_DrawersOnly -- (V4) [IS.], BOOL}

\subsubsection*{FUNCTION}
Indicate whether you only want drawers to be displayed.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Directory, MUIA\_Dirlist\_FilesOnly

\subsection[MUIA\_Dirlist\_FilesOnly]{MUIA\_Dirlist\_FilesOnly -- (V4) [IS.], BOOL}

\subsubsection*{FUNCTION}
Indicate whether you only want files to be displayed.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Directory, MUIA\_Dirlist\_DrawersOnly

\subsection[MUIA\_Dirlist\_FilterDrawers]{MUIA\_Dirlist\_FilterDrawers -- (V4) [IS.], BOOL}

\subsubsection*{FUNCTION}
Indicate whether you want drawers matched agains
MUIA\_Dirlist\_RejectPattern and
MUIA\_Dirlist\_AcceptPattern.

Defaults to FALSE.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_RejectPattern, MUIA\_Dirlist\_AcceptPattern

\subsection[MUIA\_Dirlist\_FilterHook]{MUIA\_Dirlist\_FilterHook -- (V4) [IS.], struct Hook $\ast$}

\subsubsection*{FUNCTION}
A hook to call for each file encountered. If the
function returns TRUE, the file is included in the
file list, otherwise it is rejected and not displayed.
The function receives the following parameters:

\begin{center} \begin{tabular}{lclcl}
A0 &-& (struct Hook $\ast$)      &-& the hook itself\\
A1 &-& (struct ExAllData $\ast$) &-& valid upto ed\_Comment\\
A2 &-& (Object $\ast$)           &-& the dirlist object\\
\end{tabular} \end{center}

All other filter attributes are ignored when a
MUIA\_Dirlist\_FilterHook is set.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Directory

\subsection[MUIA\_Dirlist\_MultiSelDirs]{MUIA\_Dirlist\_MultiSelDirs -- (V6) [IS.], BOOL}

\subsubsection*{FUNCTION}
Allows multi selection of directories.
Defaults to FALSE.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_FilterDrawers

\subsection[MUIA\_Dirlist\_NumBytes]{MUIA\_Dirlist\_NumBytes -- (V4) [..G], LONG}

\subsubsection*{FUNCTION}
When MUIA\_Dirlist\_Status is MUIV\_Dirlist\_Valid, you can
obtain the number of bytes occupied by the directory
from this tag.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_NumFiles, MUIA\_Dirlist\_NumDrawers

\subsection[MUIA\_Dirlist\_NumDrawers]{MUIA\_Dirlist\_NumDrawers -- (V4) [..G], LONG}

\subsubsection*{FUNCTION}
When MUIA\_Dirlist\_Status is MUIV\_Dirlist\_Valid, you can
obtain the number of drawers in the displayed directory
from this tag.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_NumFiles, MUIA\_Dirlist\_Status

\subsection[MUIA\_Dirlist\_NumFiles]{MUIA\_Dirlist\_NumFiles -- (V4) [..G], LONG}

\subsubsection*{FUNCTION}
When MUIA\_Dirlist\_Status is MUIV\_Dirlist\_Valid, you can
obtain the number of files in the displayed directory
from this tag.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_NumDrawers, MUIA\_Dirlist\_Status

\subsection[MUIA\_Dirlist\_Path]{MUIA\_Dirlist\_Path -- (V4) [..G], STRPTR}

\subsubsection*{FUNCTION}
When MUIA\_Dirlist\_Status is MUIV\_Dirlist\_Valid and
you have an active entry in the list (MUIA\_List\_Active
not equal MUIV\_List\_Active\_Off), you will receive
a pointer to the complete path specification of
the selected file. Otherwise you get a NULL.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Status

\subsection[MUIA\_Dirlist\_RejectIcons]{MUIA\_Dirlist\_RejectIcons -- (V4) [IS.], BOOL}

\subsubsection*{FUNCTION}
Indicate whether you want icons ($\ast$.info files)
to be rejected.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Directory

\subsection[MUIA\_Dirlist\_RejectPattern]{MUIA\_Dirlist\_RejectPattern -- (V4) [IS.], STRPTR}

\subsubsection*{FUNCTION}
Entries matching this pattern are rejected.
Note that the pattern has to be parsed with
dos.library/ParsePatternNoCase().

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_AcceptPattern, MUIA\_Dirlist\_FilterDrawers

\subsection[MUIA\_Dirlist\_SortDirs]{MUIA\_Dirlist\_SortDirs -- (V4) [IS.], LONG}

\subsubsection*{SPECIAL INPUTS}
MUIV\_Dirlist\_SortDirs\_First\\
MUIV\_Dirlist\_SortDirs\_Last\\
MUIV\_Dirlist\_SortDirs\_Mix

\subsubsection*{FUNCTION}
Adjust the place where directories shall be displayed.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_SortHighLow, MUIA\_Dirlist\_SortType

\subsection[MUIA\_Dirlist\_SortHighLow]{MUIA\_Dirlist\_SortHighLow -- (V4) [IS.], BOOL}

\subsubsection*{FUNCTION}
Indicate if you want to sort your directory
reversely.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_SortType, MUIA\_Dirlist\_SortDirs

\subsection[MUIA\_Dirlist\_SortType]{MUIA\_Dirlist\_SortType -- (V4) [IS.], LONG}

\subsubsection*{SPECIAL INPUTS}
MUIV\_Dirlist\_SortType\_Name\\
MUIV\_Dirlist\_SortType\_Date\\
MUIV\_Dirlist\_SortType\_Size

\subsubsection*{FUNCTION}
Indicate what fields should be used as sort criteria.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_SortDirs, MUIA\_Dirlist\_SortHighLow

\subsection[MUIA\_Dirlist\_Status]{MUIA\_Dirlist\_Status -- (V4) [..G], LONG}

\subsubsection*{SPECIAL INPUTS}
MUIV\_Dirlist\_Status\_Invalid\\
MUIV\_Dirlist\_Status\_Reading\\
MUIV\_Dirlist\_Status\_Valid

\subsubsection*{FUNCTION}
Read the status of the dirlist object. The result is
one of

MUIV\_Dirlist\_Status\_Invalid:
object contains no valid directory.

MUIV\_Dirlist\_Status\_Reading 1:
object is currently reading a new directory.

MUIV\_Dirlist\_Status\_Valid 2
object contains a valid directory.

\subsubsection*{SEE ALSO}
MUIA\_Dirlist\_Directory


